package verticalsticks;

import java.util.Arrays;
import java.util.Scanner;
public class Solution
{
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		try {
			int no_cases = scanner.nextInt();
			for (int i = 0; i < no_cases; i++) {
				int n = scanner.nextInt();
				int[] input = new int[n];
				for(int j = 0; j < n; j++) {
					input[j] = scanner.nextInt();
				}        
				System.out.printf("%.2f\n", getExpectedValue(input));
			}
		} finally {
			scanner.close();
		}
	}
	private static double getExpectedValue(int[] input)
	{
		double sum = 0;
		Arrays.sort(input);
		double[] memo = new double[50];
		for(int i = 0; i < input.length; i++){
			sum += getEvElement(input, memo, i);
		}
		return sum;
	}

	private static double getEvElement(int[] input, double[] memo, int index)
	{
		int l = 0;
		final int n = input[index];
		final int length = input.length;
		for(int i = index; i >= 0; i--){
			if (input[i] < n){
				l = i + 1;
				break;
			}
		}
		int eq = length - l - 1;
		if (memo[l] > 0) return memo[l];
		final double result = calculateEv(eq, l, length);
		memo[l] = result;
		return result;
	}

	private static double calculateEv(int eq, int l, int length)
	{
		double[] weight = new double[length + 1];
		double[] weightedSum = new double[length + 1];
		double[] result = new double[length + 1];
		for (int x = 1; x <= length; x++){
			if (x > l + 1){
				result[x] = result[x - 1];
			}
			else {
				final int slot = x - 1;
				int total = eq + l;
				if (slot == 0){
					weight[x] = 1D;
					weightedSum[x] = (1D * eq) / total;
				}
				else {
					int i = slot - 1;
					weight[x] = (weight[x - 1] * (l - i)) / (total - i);
					weightedSum[x] = weightedSum[x - 1] + (((weight[x] * eq)/(total - slot)) * x);
				}
				result[x] = weight[x] * x + weightedSum[x - 1];
			}
		}
		double s = 0;
		for (int x = 1; x <= length; x++){
			s += result[x];
		}
		return s/length;
	}
}
